/*
 * Copyright 2009 Kaspar Minosiants http://www.minosiants.com.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.minosiants.confluence.blog.plugin.impl.tweet2it;

import java.io.Serializable;

/**
 *	Project home: http://tweet2it.minosiants.com
 *
 *  @author Kaspar Minosiants
 *
 * 	$Id:$
 */
public class OAuthUserData implements Serializable{

	private static final long serialVersionUID = 1817020481292501511L;
	private String token;
	private String secret; 
	private String userId;
	public OAuthUserData(String token, String secret, String userId) {
		super();
		this.token = token;
		this.secret = secret;
		this.userId = userId;
	}
	public String getToken() {
		return token;
	}
	public String getSecret() {
		return secret;
	}
	public String getUserId() {
		return userId;
	}
	
	@Override
	public String toString() {
		return userId;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((secret == null) ? 0 : secret.hashCode());
		result = prime * result + ((token == null) ? 0 : token.hashCode());
		result = prime * result + ((userId == null) ? 0 : userId.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		OAuthUserData other = (OAuthUserData) obj;
		if (secret == null) {
			if (other.secret != null)
				return false;
		} else if (!secret.equals(other.secret))
			return false;
		if (token == null) {
			if (other.token != null)
				return false;
		} else if (!token.equals(other.token))
			return false;
		if (userId == null) {
			if (other.userId != null)
				return false;
		} else if (!userId.equals(other.userId))
			return false;
		return true;
	}
	
}
